﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Public Class TicketsFact
    Public Shared Function Build(ByVal dr As OdbcDataReader) As TicketsBE
        Dim tmpTickets As TicketsBE = New TicketsBE()
        Try
            With tmpTickets
                .Auto = convertDTFromDb.ConvertString(dr.Item("Auto"))
                .Cambio = convertDTFromDb.ConvertDecimal(dr.Item("Cambio"))
                .Cedula = convertDTFromDb.ConvertString(dr.Item("Cedula"))
                .Comision = convertDTFromDb.ConvertDecimal(dr.Item("Comision"))
                .Dom = convertDTFromDb.ConvertString(dr.Item("Dom"))
                .FCancela = convertDTFromDb.convertDateTime(dr.Item("FCancela"))
                .Fecha = convertDTFromDb.convertDateTime(dr.Item("Fecha"))
                .IdBanco = convertDTFromDb.ConvertString(dr.Item("IdBanco"))
                .IdCaja = convertDTFromDb.convertInt32(dr.Item("IdCaja"))
                .IdCliente = convertDTFromDb.ConvertString(dr.Item("IdCliente"))
                .IdCorte = convertDTFromDb.ConvertLong(dr.Item("IdCorte"))
                .IdEmpresa = convertDTFromDb.ConvertShort(dr.Item("IdEmpresa"))
                .IdTarjeta = convertDTFromDb.convertInt32(dr.Item("IdTarjeta"))
                .IdTicket = convertDTFromDb.convertInt32(dr.Item("IdTicket"))
                .IdVendedor = convertDTFromDb.convertInt32(dr.Item("IdVendedor"))
                .IEPS = convertDTFromDb.ConvertDecimal(dr.Item("IEPS"))
                .Importe1 = convertDTFromDb.ConvertDecimal(dr.Item("Importe1"))
                .Importe2 = convertDTFromDb.ConvertDecimal(dr.Item("Importe2"))
                .ImporteME = convertDTFromDb.ConvertDecimal(dr.Item("ImporteME"))
                .ImporteR = convertDTFromDb.ConvertDecimal(dr.Item("ImporteR"))
                .ImporteT = convertDTFromDb.ConvertDecimal(dr.Item("ImporteT"))
                .IVA = convertDTFromDb.ConvertDecimal(dr.Item("IVA"))
                .IVAB = convertDTFromDb.ConvertDecimal(dr.Item("IVAB"))
                .MonederoG = convertDTFromDb.ConvertDecimal(dr.Item("MonederoG"))
                .Numero = convertDTFromDb.convertInt32(dr.Item("Numero"))
                .Observaciones = convertDTFromDb.ConvertString(dr.Item("Observaciones"))
                .Prescribe = convertDTFromDb.ConvertString(dr.Item("Prescribe"))
                .Receta = convertDTFromDb.ConvertString(dr.Item("Receta"))
                .Saldo = convertDTFromDb.ConvertDecimal(dr.Item("Saldo"))
                .Serie = convertDTFromDb.ConvertString(dr.Item("Serie"))
                .Status = convertDTFromDb.ConvertString(dr.Item("Status"))
                .Usr = convertDTFromDb.ConvertString(dr.Item("Usr"))
                .UsrCancela = convertDTFromDb.ConvertString(dr.Item("UsrCancela"))
                .UtilizaoME = convertDTFromDb.ConvertShort(dr.Item("UtilizaoME"))
            End With
            Return tmpTickets
        Catch ex As Exception
            Throw
        Finally
            tmpTickets = Nothing
        End Try
    End Function
End Class
